package net.begincode.handler;

import net.begincode.model.Server;
import net.begincode.service.ServerService;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import java.util.List;

/**
 * Created by saber on 2017/9/23.
 */
@Component
public class ServerHandler {

    @Resource
    private ServerService serverService;

    /**
     * 查询所有服务
     * @return list 服务
     */
    public List<Server> listServer(){
        return serverService.listServer();
    }

    /**
     * 查询所有未删除服务

     * @return list 服务
     */
    public List<Server> listServerUnDel(){
        return serverService.listServerUnDel();
    }

    /**
     * 修改服务
     * @param server
     * @param serverId
     * @return Integer
     */
    public Integer updateServer(Server server ,Integer serverId){
        return serverService.updateServer(server, serverId);
    }

    /**
     * 新增服务
     * @param server
     * @return Integer
     */
    public Integer insertServer(Server server){
        return serverService.insertServer(server);
    }

    /**
     * 删除服务
     * @param serverId
     * @return Integer
     */
    public Integer deleteServer(Integer serverId){
        return serverService.deleteServer(serverId);
    }


}
